<%--
   Document   : temp
   Created on : Oct 4, 2012, 4:10:02 PM
   Author     : MinhThang
--%>

<%@page import="org.apt.Bean.LectureAuthorEntities"%>
<%@page import="com.myapp.DAO.LectureAuthorDao"%>
<%@page import="org.apt.connectDB.Tools"%>
<%@page import="java.util.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>National Level Paper Presentation</title>
        <link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->

        <!-- JavaScripts-->
        <script type="text/javascript" src="style/js/jquery.js"></script>
        <script type="text/javascript" src="style/js/jNice.js"></script>
    </head>
    <body>
        <%
                    if (session.getAttribute("AdminUser") == null || session.getAttribute("AdminUser").toString() == "") {
                        response.sendRedirect("/Admin/adminlogin.jsp");
                    }
        %>
        <div id="wrapper">
            <h1><a href="#"><span>Admin Paper Presentation</span></a></h1>
            <div><%@include file="Template/header.jsp" %></div>
            <div id="containerHolder">
                <div id="sidebar">
                    <ul class="sideNav">
                        <li class="limenu"><a href="list_lecture.jsp"  class="active">List lecture</a></li>
                        <li  class="limenu"><a href="list_author_lecture.jsp">List Author</a></li>
                        <li class="limenu"><a href="create_author_lecture.jsp">Create author</a></li>
                        <li class="limenu"><a href="create_lecture_event.jsp">Create Lecture event</a></li>
                        <li class="limenu"><a href="event_and_lecture.jsp">Event and lecture</a></li>
                    </ul>
                    <!-- // .sideNav -->
                </div>
                <h2><a href="#">Lecture >></a> <a href="#" class="active">Author</a></h2>
                <div id="main">
                    <form action="authorjoinlecture.do" method="post">

                        <%
                                    String authorID = request.getParameter("ID");
                                    LectureAuthorEntities author = LectureAuthorDao.getLectureAuthorByLectureID(Integer.parseInt(authorID));
                                    if (author != null) {
                        %>
                        <table>
                            <tr>
                                <td>
                                    <b>Name :</b>
                                    <input type="hidden" name="txtAuthorID" value="<%=request.getParameter("ID").toString()%>"/>
                                </td>
                                <td>
                                    <%= rs.getString("FullName").toString()%>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>Email :</b>
                                </td>
                                <td>
                                    <%= rs.getString("Email").toString()%>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>ID :</b>
                                </td>
                                <td>
                                    <%= rs.getString("IDCard").toString()%>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>Phone Number :</b>
                                </td>
                                <td>
                                    <%= rs.getString("MobilePhone").toString()%>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>Address :</b>
                                </td>
                                <td>
                                    <%= rs.getString("Address").toString()%>
                                </td>
                            </tr>
                            <tr>
                                <td>

                                </td>
                                <td>
                                    <img src="../images/<%=rs.getString("Image").toString()%>" width="100" height="120"/>
                                </td>
                            </tr>
                        </table>
                        <%}
                        %>
                        <table>
                            <tr>
                            <h3>List lecture</h3>
                            </tr>
                            <tr>
                                <td><b>Name lecture</b></td>
                                <td><b>Summary</b></td>
                            </tr>
                            <%
                                        ps = conn.prepareCall(sql2);
                                        ps.setInt(1, Integer.parseInt(request.getParameter("ID").toString()));
                                        rs =
                                                ps.executeQuery();




                                        while (rs.next()) {
                            %>
                            <tr>
                                <td>
                                    <%=rs.getString("Title").toString()%>
                                </td>
                                <td>
                                    <%=rs.getString("Summary").toString()%>
                                </td>
                            </tr>
                            <%




                                        }
                            %>

                        </table>
                        <table>
                            <tr><h3>Add lecture to author</h3></tr>
                            <tr>
                                <td><b>Choose a lecture</b></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><select name="ddlLecture">
                                        <%
                                                    ps = conn.prepareCall(sql3);
                                                    ps.setInt(1, Integer.parseInt(request.getParameter("ID").toString()));
                                                    rs =
                                                            ps.executeQuery();




                                                    while (rs.next()) {
                                        %>
                                        <option value="<%=rs.getString("LectureID").toString()%>"><%=rs.getString("Title").toString()%></option>
                                        <%


                                                    }
                                        %>

                                    </select></td>
                                <td><input type="submit" value="Add lecture"/></td>
                            </tr>
                            <tr>
                                <td></td><td></td>
                            </tr>
                            <tr>
                                <td></td><td></td>
                            </tr>
                            <tr>
                                <td></td><td></td>
                            </tr>
                            <tr>
                                <td></td><td></td>
                            </tr>
                        </table>
                    </form>
                </div>
                <!-- // #main -->
                <div class="clear"></div>
            </div>
        </div>
    </body>
</html>
